package com.lg.tochat.controller;

import com.lg.tochat.aiService.ConsultantService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
@RestController
@RequestMapping("/langchain4j")
@ApiResponse(description = "langchain4j接口")
public class langchain4jController {
    @Resource
    private ConsultantService consultantService;
    @Operation(description = "文字聊天")
    @PostMapping(value = "/chat" , produces = "text/html;charset=utf-8")
    public Flux<String> chat(String memoryId , String message){
        Flux<String> result = consultantService.chat(memoryId , message);
        return result;
    }
}
